package com.jackchan.homework.sysw.entity;

import com.jackchan.homework.common.IdEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by ch-hui on 16/2/10.
 * 生产单
 */
@Entity
@Table(name = "t_order")
public class Order extends IdEntity {


    private Recipe recipe;

    // 生产总量
    private Double totalAmount;

    // 生产总成本
    private Double totalCost;

    // 生产单日期
    private Date orderTime;

    private Integer orderStatus;


    @ManyToOne
    @JoinColumn(name = "recipe_id", referencedColumnName = "id")
    public Recipe getRecipe() {
        return recipe;
    }

    public void setRecipe(Recipe recipe) {
        this.recipe = recipe;
    }

    @Column(name = "total_amount")
    public Double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Double totalAmount) {
        this.totalAmount = totalAmount;
    }

    @Column(name = "total_cost")
    public Double getTotalCost() {
        return totalCost;
    }

    public void setTotalCost(Double totalCost) {
        this.totalCost = totalCost;
    }

    @Column(name = "order_time")
    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    @Column(name = "order_status")
    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }
}
